package com.example.aptdemo

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.appcompat.widget.Toolbar
import com.example.lib_router_anntation.BindView
import com.example.lib_router_anntation.BindView2
import com.example.lib_router_anntation.RouterPath
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.youth.routercore.Router
import com.youth.routercore.Router.launch

@RouterPath("/main/MainActivity")
class MainActivity : AppCompatActivity() {
    @BindView(R.id.fab)
    lateinit var fabView: FloatingActionButton
    @BindView2(R.id.toolbar)
    lateinit var toolbar: Toolbar
    @RouterPath("/main/MainActivity")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        findViewById<FloatingActionButton>(R.id.fab).setOnClickListener {
            Router.routerService<ITest>()?.print(this)
            Router.path("/main/MainActivity2").launch()
        }
    }
}